<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'leftCategory.jsp' starting page</title>


<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="assets/ico/bioroad-logo.ico" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap-scrollspy.js"></script>
<script type="text/javascript" src="js/bootstrap-tab.js"></script>
<style type="text/css">

.leftDiv {
	padding-left: 10px;
	margin-left: 0px;
	margin-top:12px;
	font-family: 方正静蕾简体;
	background-color: #FDFDFD;
	background-image: url("image/frenchstucco.png");
	border-radius: 0px 160px 6px 0px;
	width: 260px;
	height: auto;
}

.diseaseCategorySn {
	cursor: pointer;
}
</style>
</head>

<body>
	<div class="leftDiv">
		<h2 style="padding-top:60px;">病例的分类</h2>
		<br> <span><a id="allfolds" href="javascript:void(0)"
			onclick="allFold()">－</a> 全部折叠</span> <br />
		<c:forEach var="diseaseCategory" items="${diseaseCategoryList }">

			<span class="diseaseCategorySn" id="stackFirst${diseaseCategory.sn}">
				＋<input type="hidden" name="diseaseCategorySnHidden"
				value="${diseaseCategory.sn }" /> </span><li class="icon-hand-right"></li>${diseaseCategory.name}
		<br />

			<div class="typeanddisease" id="stackTwo${diseaseCategory.sn}"
				style="display: none">

				<c:forEach var="diseaseType" items="${diseaseCategory.diseaseTypes}">
&nbsp;&nbsp;
				<%--第二层的东西------------------------- --%>
					<span class="diseaseTypeSn" id="stackSecound${diseaseType.sn}">
						＋<input type="hidden" name="diseaseTypeSnHidden"
						value="${diseaseType.sn}" /> </span>${diseaseType.name}
				<br />
					<div class="diseaseType" id="stackThree${diseaseType.sn}"
						style="display:none">
						<c:forEach var="disease" items="${diseaseType.diseases}">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="searchResultPage.action?sn=${disease.sn }">${disease.name}</a>
							<br />
						</c:forEach>
						<br />
					</div>
				</c:forEach>
				<hr />
			</div>
		</c:forEach>

	</div>
</body>
<script type="text/javascript">
$(function() {
	$("#allfolds").click(function() {
		$(".typeanddisease").css("display", "none");
		$(".diseaseCategorySn").text("＋");
		$("#allfolds").text(" ＋ ");
	});
	$(".diseaseCategorySn").each(function() {
		var diseaseCategorySn = $(this).children().val();
		$("#stackFirst" + diseaseCategorySn).toggle(function() {
			$("#stackTwo" + diseaseCategorySn).css("display", "block");
			$("#stackFirst" + diseaseCategorySn).text("－");
		}, function() {
			$("#stackTwo" + diseaseCategorySn).css("display", "none");
			$("#stackFirst" + diseaseCategorySn).text("＋");
		});

	});

	$(".diseaseTypeSn").each(function() {
		var diseaseTypeSn = $(this).children().val();
		$("#stackSecound" + diseaseTypeSn).toggle(function() {
			$("#stackThree" + diseaseTypeSn).css("display", "block");
			$("#stackSecound" + diseaseTypeSn).text("－");
		}, function() {
			$("#stackThree" + diseaseTypeSn).css("display", "none");
			$("#stackSecound" + diseaseTypeSn).text("＋");
		});

	});
});
</script>
</html>
